from django.contrib import admin

# Register your models here.

# 导入模型类
from BookApp.models import BookInfo,HeroInfo


# 创建模型类对应的后台管理类
class BookInfoAdmin(admin.ModelAdmin):
    """书籍后台管理类"""
    list_display = ("id","title","author","money","time")


class HeroInfoAdmin(admin.ModelAdmin):
    """英雄后台管理类"""
    list_display = ("id","name","age","gender","descripthion","fromBook")



# 注册各模型到后台管理
admin.site.register(BookInfo,BookInfoAdmin)
admin.site.register(HeroInfo,HeroInfoAdmin)


# 去终端执行 : python3 manage.py createsuperuser 创建管理员账户 lff:lff12345
# 去终端执行 : python3 manage.py runserver  (后台管理地址为:http://127.0.0.1:8000/admin/)